package devicestest;

public class TimerTest2 implements core.interfaces.InterruptInterface{
	devices.Timer timer;
	core.MemoryClass mem;

	public TimerTest2(){
		this.mem = new core.MemoryClass();

		this.timer = new devices.Timer(this.mem, this);
		try {java.lang.Thread.sleep(1000);} catch (InterruptedException e) {}

		this.mem.setWord(0xFFFD, (short)5); //Data
		this.mem.setWord(0xFFFC, (short)0x0000); //Control
		this.timer.reloadConfiguration();
		try {java.lang.Thread.sleep(6000);} catch (InterruptedException e) {}

		this.mem.setWord(0xFFFC, (short)0x8005); //Control
		this.timer.reloadConfiguration();
		try {java.lang.Thread.sleep(5000);} catch (InterruptedException e) {}

		this.mem.setWord(0xFFFC, (short)0x8003); //Control
		this.timer.reloadConfiguration();
		try {java.lang.Thread.sleep(5000);} catch (InterruptedException e) {}

		this.mem.setWord(0xFFFC, (short)0x8007); //Control
		this.timer.reloadConfiguration();
		try {java.lang.Thread.sleep(5000);} catch (InterruptedException e) {}

		this.timer.reloadConfiguration();
	}

	public static void main(java.lang.String args[]){
		new devicestest.TimerTest2();
	}

	public void lowerInterruptLine(int line) {
	}

	public void raiseInterruptLine(int line) {
		System.out.printf("Interrupt raised (%d)\n", line);
	}
}
